<!-- 必须全局拥有唯一的id -->
<div id="resourceSet">
  <yu-panel :title="$t('resourceSetManager.gnsq')">
    <el-row :gutter="20">
      <!--对象部分-->
      <el-col :span="13">
        <div style="margin-top: 10px;margin-bottom: 10px;">
          <el-row :gutter="20">
            <el-col :span="14">
              <el-select clearable v-model="showObjectFlag" :placeholder="$t('resourceSetManager.dxlx')" @change="change">
                <el-option v-for="item in typeOptions" :key="item.key" :value="item.key" :label="item.value+'('+item.key+')'"></el-option>
              </el-select>
            </el-col>
            <el-col :span="10">
              <el-button @click="copyInfoFn" style="margin-left: 33px;" v-if="copyButton">{{ $t('resourceSetManager.fz') }}
              </el-button>
              <el-button @click="exportInfoFn">{{ $t('resourceSetManager.dc') }}</el-button>
            </el-col>
          </el-row>
        </div>
        <!--角色对象-->
        <div class="filter-container" v-show="showObjectFlag ==='R'">
          <div class="filter-container" style="margin: 10px 0">
            <el-row :gutter="4">
              <el-col :span="5">
                <yufp-org-tree v-model="roleGrid.query.orgId" :params="roleGrid.params" :placeholder="$t('resourceSetManager.jsssjg')" style="width: 120px;"></yufp-org-tree>
              </el-col>
              <el-col :span="19">
                <el-input v-model="roleGrid.query.roleCode" :placeholder="$t('resourceSetManager.jsdm')" style="float:left; width: 120px;margin-left: 10pxmargin-left: 10px"></el-input>
                <el-input v-model="roleGrid.query.roleName" :placeholder="$t('resourceSetManager.jsmc')" style="float:left; width: 120px;margin-left: 10px"></el-input>
                <el-button type="primary" @click="queryRoleFn" style="margin-left: 20px;">{{ $t('resourceSetManager.cx') }}
                </el-button>
                <el-button @click="resetQueryRoleFn">{{ $t('resourceSetManager.zz') }}</el-button>
              </el-col>
            </el-row>
          </div>
          <el-table-x ref="roleTable" @row-click="selectRowRole" :radiobox="roleGrid.checkbox" :height="roleGrid.height" :data-url="roleGrid.dataUrl"
            :base-params="roleGrid.dataParams" :table-columns="roleGrid.tableColumns">
          </el-table-x>
        </div>
        <!--机构树对象-->
        <div class="filter-container" v-show="showObjectFlag ==='G'">
          <yufp-ext-tree ref="orgTree" @node-click="orgClickFn" :show-checkbox="false" :height="orgTree.height" :data-url="treeUrl"
            data-id="orgId" data-label="orgName" data-pid="upOrgId" :data-root="orgRoot" :data-params="{'orgSts':'A','lazy':true}"
            :root-visible="true" lazy :highlight-current="true"></yufp-ext-tree>
        </div>
        <!--部门对象-->
        <div class="filter-container" v-show="showObjectFlag ==='D'">
          <div class="filter-container" style="margin: 10px 0">
            <el-row :gutter="4">
              <el-col :span="5">
                <yufp-org-tree v-model="dptGrid.query.belongOrgId" :params="dptGrid.params" :placeholder="$t('resourceSetManager.ssjg')">
                </yufp-org-tree>
              </el-col>
              <el-col :span="19">
                <el-input v-model="dptGrid.query.dptCde" :placeholder="$t('resourceSetManager.bmdm')" style="width: 120px;margin-left: 10px"></el-input>
                <el-input v-model="dptGrid.query.dptName" :placeholder="$t('resourceSetManager.bmmc')" style="width: 120px;margin-left: 10px"></el-input>
                <el-button type="primary" @click="queryDptFn" style="margin-left: 20px;">{{ $t('resourceSetManager.cx') }}
                </el-button>
                <el-button @click="resetDptRoleFn">{{ $t('resourceSetManager.zz') }}</el-button>
              </el-col>
            </el-row>
          </div>
          <el-table-x ref="dptTable" @row-click="rowClickFnDep" :checkbox="dptGrid.checkbox" :height="dptGrid.height" :data-url="dptGrid.dataUrl"
            :base-params="dptGrid.dataParams" :table-columns="dptGrid.tableColumns">
          </el-table-x>
        </div>
        <!--用户对象-->
        <div class="filter-container" v-show="showObjectFlag ==='U'">
          <div class="filter-container" style="margin: 10px 0">
            <el-row :gutter="4">
              <el-col :span="5">
                <yufp-org-tree v-model="userGrid.query.orgId" :params="userGrid.params" :placeholder="$t('resourceSetManager.ssjg')">
                </yufp-org-tree>
              </el-col>
              <el-col :span="19">
                <el-input v-model="userGrid.query.userInfo" :placeholder="$t('resourceSetManager.dldmyhm')" style="width: 220px;"></el-input>
                <el-button type="primary" @click="queryUserFn" style="margin-left: 20px;">{{ $t('resourceSetManager.cx') }}
                </el-button>
                <el-button @click="resetUserFn">{{ $t('resourceSetManager.zz') }}</el-button>
              </el-col>
            </el-row>
          </div>
          <el-table-x ref="userTable" @row-click="selectRowUser" :checkbox="userGrid.checkbox" :height="userGrid.height" :data-url="userGrid.dataUrl"
            :base-params="userGrid.dataParams" :table-columns="userGrid.tableColumns">
          </el-table-x>
        </div>
      </el-col>
      <!--资源部分-->
      <el-col :span="11">
        <!--菜单和控制点资源-->
        <el-row :gutter="10">
          <el-col :span="12">
            <yu-toolBar>
              <el-button @click="selectAllFn" v-if="selectAllButton" :disabled="ifTreeButton">{{ $t('resourceSetManager.qx') }}
              </el-button>
              <el-button @click="reSelectFn" v-if="setOtherButton" :disabled="ifTreeButton">{{ $t('resourceSetManager.fx') }}
              </el-button>
              <el-button @click="reSetFn" v-if="resetButton" :disabled="ifTreeButton">{{ $t('resourceSetManager.zz') }}</el-button>
            </yu-toolBar>
          </el-col>
          <el-col :span="12">
            <el-input :placeholder="$t('resourceSetManager.srgjz')" v-model="filterText" style="margin-top: 10px;margin-left: -35px;"></el-input>
          </el-col>
        </el-row>
        <yufp-ext-tree ref="menuTree" :show-checkbox="menuTree.treeCheckBox" :height="menuTree.height" :data-url="reourceUrl" data-id="id"
          data-label="menuName" v-loading="menuTree.loading" element-loading-:text="$t('resourceSetManager.pmjzz')" node-key="id"
          :expand-level="1" data-pid="upMenuId" data-root="0" :data-params="menuTree.dataParams" :render-content="renderContent"
          :filter-node-method="filterNode" accordion>
        </yufp-ext-tree>
      </el-col>
    </el-row>
    <!--{{ $t('resourceSetManager.bc') }}按钮-->
    <div align="center" style="margin-top: 20px;">
      <el-button type="primary" @click="saveAllInfoFn" center>{{ $t('resourceSetManager.bc') }}</el-button>
    </div>
  </yu-panel>

  <!-- {{ $t('resourceSetManager.fz') }} -->
  <el-dialog-x :center="true" :title="$t('resourceSetManager.ztdxxz')" :visible.sync="dialogVisible">
    <el-table-x ref="roleTable1" :radiobox="true" v-if="roleShow" :default-load="false" :base-params="roleGrid.dataParams" :data-url="roleGrid.dataUrl"
      :table-columns="roleGrid.tableColumns">
    </el-table-x>
    <el-table-x ref="dptTable1" :radiobox="true" v-if="dptShow" :data-url="dptGrid.dataUrl" :data-params="dptGrid.dataParams"
      :table-columns="dptGrid.tableColumns">
    </el-table-x>
    <el-table-x ref="userTable1" :radiobox="true" v-if="userShow" :data-url="userGrid.dataUrl" :data-params="userGrid.dataParams"
      :table-columns="userGrid.tableColumns">
    </el-table-x>
    <yufp-ext-tree ref="orgTree1" :show-checkbox="false" :height="orgTree.height" v-if="orgTreeShow" :data-url="treeUrl" data-id="orgCode"
      data-label="orgName" @node-click="orgClickFn1" data-pid="upOrgId" :data-root="orgRootId" :highlight-current="true"></yufp-ext-tree>
    <div slot="footer" class="dialog-footer" align="center">
      <el-button type="primary" @click="copyCheck">{{ $t('resourceSetManager.qd') }}</el-button>
      <el-button @click="dialogVisible=false">{{ $t('resourceSetManager.qx') }}</el-button>
    </div>
  </el-dialog-x>
</div>